import {configureStore} from '@reduxjs/toolkit'
import counterSlice from '@/store/modules/counter'
import collectSlice from '@/store/modules/collect'
import shopcartSlice from '@/store/modules/shopcart'
import logger from 'redux-logger'
/*
    通过@reduxjs/tooklit核心包中的configStore来创建store对象
    configStore该方法的参数是一个配置对象
    该配置对象的中间的属性如下
    reducer:reducer的模块配置
*/
const store=configureStore({
    reducer:{
        counter:counterSlice,
        collect:collectSlice,
        shopcart:shopcartSlice
    },
    devTools:true,
    middleware:(getDefaultMiddleWare)=>getDefaultMiddleWare().concat(logger)
})
export default store